package com.sikaryofficial.backend.controller;

import com.sikaryofficial.backend.domain.dto.req.points.GuideTaskReq;
import com.sikaryofficial.backend.domain.dto.resp.points.GuideTaskDTO;
import com.sikaryofficial.backend.manager.GuideTaskManager;
import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.common.log.annotation.Log;
import com.sikaryofficial.common.log.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : wuweihong
 * @desc : 指引任务后台管理
 * @date : 2024-12-09
 */

@RestController
@RequestMapping("/guidetask/backend")
@Api(tags = "指引任务后台管理")
@Slf4j
public class GuideTaskController {

	@Autowired
	private GuideTaskManager guideTaskManager;

	/**
	 * 执行指引任务
	 */
	@Log(title = "指引任务", businessType = BusinessType.INSERT)
	@PostMapping(value = "/process")
	@ApiOperation("执行指引任务")
	public R<Boolean> processTask(@Validated @RequestBody GuideTaskReq req) {
		return R.ok(guideTaskManager.processTask(req));
	}

	@GetMapping(value = "/taskList")
	@ApiOperation(value = "获取指引任务列表", notes = "固定返回四个任务列")
	public R<List<GuideTaskDTO>> getTaskList() {
		return R.ok(guideTaskManager.getTaskList());
	}

}
